package it.univaq.mwt.frontoffice.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.validator.ValidatorForm;

public class GiftForm extends ValidatorForm{

	private static final long serialVersionUID = 1L;
	
	private String id_gift=null;
	private String title=null;
	private String description=null;
	private String link=null;
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getLink() {
		return link;
	}
	public void setLink(String link) {
		this.link = link;
	}
	public String getId() {
		return id_gift;
	}
	public void setId(String id) {
		this.id_gift = id_gift;
	}
/*	 public void reset(ActionMapping mapping, HttpServletRequest request) {
		    this.title=null;
		    this.description=null;
		    this.link=null;
		   
		    }

		  public ActionErrors validate( 
		      ActionMapping mapping, HttpServletRequest request ) {
		      ActionErrors errors = new ActionErrors();
		      
		      if( getTitle() == null || getTitle().length() < 1 ) {
		        errors.add("name",new ActionMessage("error.title.required"));
		      }
		      if( getDescription() == null || getDescription().length() < 1 ) {
			        errors.add("name",new ActionMessage("error.description.required"));
			      }
		      if( getLink() == null || getLink().length() < 1 ) {
			        errors.add("name",new ActionMessage("error.link.required"));
			      }
		     

		      return errors;
		  }
	*/
	
}
